﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using CompanyBussiness;


namespace Website.admin
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        System.Web.UI.Control ct;
        HtmlGenericControl genControl;

        protected void Page_Load(object sender, EventArgs e)
        {
            PlaceHolderLogin.Controls.Clear();
            genControl = new HtmlGenericControl("div");
            if (Request.QueryString[CONST.ACTION] == "ForgotPassword")
            {              
                ct = Page.LoadControl("Control/cForgotPassword.ascx");
                btnResetPass.Text = "";
            }
            else
            {
                ct = Page.LoadControl("Control/cLogin.ascx");
                btnResetPass.Text = "Quên mật khẩu?";
            }
            genControl.Controls.Add(ct);
            PlaceHolderLogin.Controls.Add(genControl);
        }

        protected void btnResetPass_Click(object sender, EventArgs e)
        {
            Response.Cookies[CONST.ACTION][CONST.COOKIES_ACTION_NAME] = "ForgotPassword";
            Response.Redirect("Login.aspx?"+CONST.ACTION+"=ForgotPassword");  
        }
    }
}
